package io;

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.net.URLEncoder;

public class URLCoder {
	public static void main(String[] args) throws UnsupportedEncodingException {
		String encodeStr="http%3A%2F%2F172.16.235.99%2F2%2Foauth2%2Fauthorize%3Fclient_id%3D1116639330%26response_type%3Dcode%26display%3Ddefault%26redirect_uri%3Dhttp%3A%2F%2Fapps.weibo.com%2Fjavaksfzhaohui%26from%3D%26with_cookie%3D";
		String decodeStr=URLDecoder.decode(encodeStr,"GBK");
		System.out.println(decodeStr);
		
		byte[] b=ByteToHex.hexStringToBytes("E68891");
		System.out.println(new String(b,"UTF-8"));
		
		String rawStr="中";
		System.out.println("ddd"+URLEncoder.encode(rawStr, "utf-8"));
		
		String ss="java%BB%B7%BE%B3%B1%E4%C1%BF%C5%E4%D6%C3";
		System.out.println(URLDecoder.decode(ss,"GBK"));
	}

}
